<?php defined('IN_ADMIN') or exit('No permission resources.');?>
<?php include $this->admin_tpl('header', 'admin');?>
<link rel="stylesheet" href="<?=LAY_PATH?>css/layui.css">

<div class="pad-lr-10">
        <table class="layui-table">
            <thead>
            <tr>
                <td style="width: 20px">序号</td>
                <td>姓名</td>
                <td>电话</td>
                <td>留言内容</td>
                <td>日期</td>
                <td>操作</td>
            </tr>

            </thead>
            <tbody>
            <?php $i=1;?>
            <?php foreach($data as $v){?>
                <tr style="height: 20px">
                    <td><?=$i?></td>
                    <td><?=$v['username']?></td>
                    <td><?=$v["phone"]?></td>
                    <td><?=$v['content']?></td>
                     <td><?=date("Y-m-d H:m",$v['addtime'])?></td>
                    <td><button class="layui-btn layui-btn-sm" style="background: #293846" onclick="del(<?=$v['id']?>)">删除</button></td>
                </tr>
                <?php $i++;?>
            <?php }?>
            </tbody>


        </table>
    
</div>
<script src="<?=LAY_PATH?>layui.js"></script>


<script type="text/javascript">

    /*phpcms函数，窗口撑开*/
    function test_spider(id) {
        window.top.art.dialog({id:'test'}).close();
        window.top.art.dialog({title:'<?php echo L('data_acquisition_testdat')?>',id:'test',iframe:'?m=collection&c=node&a=public_test&nodeid='+id,width:'700',height:'500'}, '', function(){window.top.art.dialog({id:'test'}).close()});
    }

    function copy_spider(id) {
        window.top.art.dialog({id:'test'}).close();
        window.top.art.dialog({title:'<?php echo L('copy_node')?>',id:'test',iframe:'?m=collection&c=node&a=copy&nodeid='+id,width:'420',height:'120'}, function(){var d = window.top.art.dialog({id:'test'}).data.iframe;var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'test'}).close()});
    }

    function import_spider() {
        window.top.art.dialog({id:'test'}).close();
        window.top.art.dialog({title:'<?php echo L('import_collection_points')?>',id:'test',iframe:'?m=collection&c=node&a=node_import',width:'420',height:'200'}, function(){var d = window.top.art.dialog({id:'test'}).data.iframe;var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'test'}).close()});
    }
    /*phpcms函数，窗口撑开*/

    /*临时图片显示函数*/
    function preview(file)
    {
        var prevDiv = document.getElementById('preview');
        if (file.files && file.files[0])
        {
            var reader = new FileReader();
            reader.onload = function(evt){
                prevDiv.innerHTML = '<img src="' + evt.target.result + '" height="80" width="300"  />';
            };
            reader.readAsDataURL(file.files[0]);
        }
        else
        {
            prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
        }
    }

    window.top.$('#display_center_id').css('display','none');
    //-->
    /*ajax删除*/
    function del(id){
        layer.confirm('确定删除吗？', {
            btn: ['确定', '取消'] //可以无限个按钮
        }, function(index, layero){
            $.post("index.php?m=webman&c=index&a=liuyan_del&pc_hash=<?=$_SESSION['pc_hash']?>", {id: id}, function (msg) {
                if (msg == "ok") {
                    layer.msg('删除成功', {icon: 1}, function () {
                        location.reload();
                    })
                }
            })
        }, function(index){
            return false
        });
    }


</script>
<script>



    layui.use(['layer','form','upload','jquery'], function(){
        var form = layui.form;  var layer = layui.layer;
        var $ = layui.jquery
            ,upload = layui.upload;

    });

</script>
</body>
</html>